package com.he.hsdyc.common.handle.parent2;

import com.he.hsdyc.service.ParentLoginService;
import me.chanjar.weixin.common.session.WxSessionManager;
import me.chanjar.weixin.mp.api.WxMpService;
import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @author
 */
@Component
@Qualifier("unsubscribeHandler_parent2")
public class UnsubscribeHandler2 extends AbstractHandler {

//    @Autowired
//    private ParentLoginService parentLoginService;

    @Override
    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
                                    Map<String, Object> context, @Qualifier("wxMpService_parent2")WxMpService wxMpService_parent2,
                                    WxSessionManager sessionManager) {
        String openId = wxMessage.getFromUser();
        this.logger.info("取消关注用户 OPENID: " + openId);
//        // TODO 可以更新本地数据库为取消关注状态
//
//        //删除家长相关表
//        parentLoginService.doParentLogout(openId);


        return null;
    }

}
